package com.atguigu.blog.article.feign;

import com.atguigu.blog.article.entity.Comment;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class CommentFeignFallbackFactory implements FallbackFactory<CommentFeignClient> {
    @Override
    public CommentFeignClient create(Throwable cause) {
        return new CommentFeignClient() {
            @Override
            public List<Comment> queryCommentList(Integer articleId) {
                List<Comment> commentList = new ArrayList<>();
                return commentList;
            }
        };
    }
}
